home *** CD-ROM | disk | FTP | other *** search
- !
- ! FILE: WORLDDEF.SCR
- !
- ! When you ENTER a world the following sequence of events occurs:
- !
- ! a) If a script exists for the current world (called WORLD###.SCO)
- ! it is called at entry point @EXIT.
- !
- ! b) If the script in a) ends with CONTINUE, or it does not exist,
- ! then this script (WORLDDEF.SCO) is called at entry point @EXIT.
- !
- ! c) The current world is saved and the destination world is loaded.
- !
- ! d) If a script exists for the new world (called WORLD###.SCO, where
- ! ### is the NEW world's number, not the old), then the script is
- ! invoked BEFORE the world is displayed on the screen at entry point
- ! @GET. NOTE THAT THE OLD WORLD IS STILL SHOWING ON THE SCREEN.
- !
- ! e) If the above script 'CONTINUE's, then the new world is displayed
- ! and the script is called again with entry point @ENTER.
- !
- ! f) If the above script ends with CONTINUE on the second call, or
- ! the script does not exist at all, then the dfault script (WORLDDEF.SCR)
- ! is called with entry pont @ENTER.
- !
- ! NOTES:
- !
- ! 1) The main purpose of the @GET entry point is to allow you to 'catch'
- ! the player BEFORE the new world is displayed. The main reason for
- ! this is that you may want to transfer the party to a 3rd destination
- ! upon certain conditions. Should you perform a transfer in the @ENTER
- ! section, the new world would 'blink' on the screen, before the party
- ! is transfered. This MAY very well be what you want to do, for example
- ! if you display some text or do some animation that shows the reason
- ! why the final destination will be different!.
- !
- ! (c) DC Software, 1992
- !
-
- !------------------------------------------------------------------------!
- :@GET
- !------------------------------------------------------------------------!
- CONTINUE; ! Allow the transfer to take place !
-
- !------------------------------------------------------------------------!
- :@ENTER
- !------------------------------------------------------------------------!
-
- L0 = 0;
- if world.entrytext(world.door) > 0 then
- readtext( world.entrytext(world.door) );
- ! if the switch is zero, the text is displayed only once !
- if world.entrytextswitch(world.door) = 0 then
- world.entrytext(world.door) = -1; ! Forget the text !
- endif;
- L0 = 1; ! Text has been displayed !
- endif;
-
- if world.type = ENDGAME then
- writeln( "Press <SPACE> to end game" );
- pause; ! Wait before ending the game !
- ENDGAME;
- endif;
-
- if L0 = 0 then
- writeln( "You are now in ", world.name );
- endif;
-
- if world.type = ARENA then
- new( npc, world.x / 2, world.y / 2 );
- endif;
-
- STOP; ! Ok. We have 'entered' the world !
-
- !------------------------------------------------------------------------!
- :@EXIT
- !------------------------------------------------------------------------!
- ! Handle exit text if any !
- if world.exittext(world.door) >= 0 then
- readtext( world.exittext(world.door) );
- if world.exittextswitch(world.door) then
- world.exittext(world.door) = -1; ! Never Again.. !
- endif;
- endif;
-
- ! Exiting from this world implies you 'enter' a door, which will lead
- ! to another world (and will cause the 'ENTER' entry point to be
- ! invoked for that other world!
- enter( world.door );
-
- ! The 'continue' command informs the driver that it's ok to perform
- ! the transfer indicated by the 'enter()' above.
- CONTINUE;
-
-
-